#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
	int dianliang;
	cin >> dianliang;
	if(dianliang <= 150){
		printf("%.1f",dianliang * 0.4463);
	}else if(dianliang <=400){
		printf("%.1f",150*0.4463 + (dianliang - 150) * 0.4663);
	}else{
		printf("%.1f",150*0.4463 + 250 * 0.4663 + (dianliang - 400) * 0.5663);
	}	
	
	return 0;
}
